#include "SQLPrivilegeItem.h"
#include "../SQLName.h"
#include "../SQLExpr.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../../../utils/listTran.h"

SQLPrivilegeItem::SQLPrivilegeItem()
{
  columns = std::make_shared<std::list<SQLName_ptr >> ();
}

SQLExpr_ptr SQLPrivilegeItem::getAction()
{
  return action;
}

void SQLPrivilegeItem::setAction(SQLExpr_ptr action)
{
  this->action = action;
}

SQLName_list_ptr SQLPrivilegeItem::getColumns()
{
  return columns;
}

void SQLPrivilegeItem::accept0(SQLASTVisitor_ptr v)
{
  if (v->visit(SharedObject(SQLPrivilegeItem)))
  {
    acceptChild(v, action);
    SQLObject_list_ptr  tmp = ListTran::tran_class<SQLName, SQLObject>(this->columns);
    acceptChild(v, tmp);
  }
  v->endVisit(SharedObject(SQLPrivilegeItem));
}
